package com.woniuxy.micromedicalserver.doctormanage.controller;

import com.woniuxy.micromedicalserver.bean.DoctorBean;
import com.woniuxy.micromedicalserver.bean.ResultMsg;
import com.woniuxy.micromedicalserver.doctormanage.service.IDoctorService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RequestMapping(value = "/doctor", produces = MediaType.APPLICATION_JSON_VALUE)
@RestController
public class DoctorController {

    @Resource
    private IDoctorService doctorServiceImpl;


    @GetMapping(value = "/{id}")
    public ResultMsg selectByID(@PathVariable("id") Integer ID){
        DoctorBean doctorBean = doctorServiceImpl.selectByID(ID);
        return new ResultMsg(true,doctorBean);
    }

    @GetMapping(value = "")
    public ResultMsg selectAll(DoctorBean doctorBean){
        List<DoctorBean> list = doctorServiceImpl.selectAll(doctorBean);
        return new ResultMsg(true,list);
    }





}
